import { RouteRecordRaw } from 'vue-router';
import { Layout } from '@/router/constant';
import { DesktopOutline } from '@vicons/ionicons5';
import { renderIcon } from '@/utils/index';

const IFrame = () => import('@/views/iframe/index.vue');

const routes: Array<RouteRecordRaw> = [
  {
    path: '/frame',
    name: 'Job',
    redirect: '/job/basicInfo',
    component: Layout,
    meta: {
      title: '任务管理',
      sort: 8,
      icon: renderIcon(DesktopOutline),
      hidden:true
    },
    children: [
      {
        path: 'basicInfo',
        name: 'basicInfo',
        meta: {
          title: '基本信息',
          frameSrc: 'http://localhost:8080/oms/home',
        },
        component: IFrame,
      },
      {
        path: 'list',
        name: 'list',
        meta: {
          title: '任务列表',
          frameSrc: 'http://localhost:8080/oms/job',
        },
        component: IFrame,
      },
      {
        path: 'example',
        name: 'example',
        meta: {
          title: '任务实例',
          frameSrc: 'http://localhost:8080/oms/instance',
        },
        component: IFrame,
      },
      {
        path: 'workflow',
        name: 'workflow',
        meta: {
          title: '任务工作流',
          frameSrc: 'http://localhost:8080/oms/workflow',
        },
        component: IFrame,
      },
      {
        path: 'wfinstance',
        name: 'wfinstance',
        meta: {
          title: '工作流实例',
          frameSrc: 'http://localhost:8080/oms/wfinstance',
        },
        component: IFrame,
      },

    ],
  },
];

export default routes;
